Skip to main content
POST
/
v1
/
campaigns
/
qualification
Examine Qualification [Deprecated]
curl --request POST \
  --url https://{cluster}.voucherify.io/v1/campaigns/qualification \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>' \
  --data '{
  "customer": {
    "source_id": "source-id",
    "metadata": {
      "key": "value"
    }
  },
  "order": {
    "amount": 10000,
    "items": [
      {
        "product_id": "product-id",
        "quantity": "1",
        "price": 10000,
        "related_object": "product",
        "product": {
          "metadata": {
            "key": "value"
          }
        }
      }
    ]
  },
  "metadata": {
    "key": "value"
  }
}'
{
  "object": "list",
  "data_ref": "data",
  "data": [
    {
      "id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA",
      "name": "<string>",
      "description": "<string>",
      "campaign_type": "GIFT_VOUCHERS",
      "type": "AUTO_UPDATE",
      "voucher": {
        "type": "DISCOUNT_VOUCHER",
        "discount": {
          "type": "AMOUNT",
          "amount_off": 100,
          "amount_off_formula": "<string>",
          "aggregated_amount_limit": 123,
          "effect": "APPLY_TO_ORDER"
        },
        "redemption": {
          "quantity": 123
        },
        "code_config": {
          "length": "<string>",
          "charset": "<string>",
          "prefix": "<string>",
          "postfix": "<string>",
          "pattern": "<string>"
        },
        "is_referral_code": true
      },
      "auto_join": true,
      "join_once": true,
      "use_voucher_metadata_schema": true,
      "validity_timeframe": {
        "duration": "PT1H",
        "interval": "P2D"
      },
      "validity_day_of_week": [
        0
      ],
      "validity_hours": {
        "daily": [
          {
            "start_time": "12:00",
            "days_of_week": [
              0
            ],
            "expiration_time": "14:00"
          }
        ]
      },
      "activity_duration_after_publishing": "<string>",
      "vouchers_count": 123,
      "start_date": "2022-09-20T00:00:00.000Z",
      "expiration_date": "2022-09-30T00:00:00.000Z",
      "active": true,
      "metadata": {},
      "created_at": "2021-12-01T08:00:50.038Z",
      "updated_at": "2022-09-20T09:18:19.623Z",
      "category": "<string>",
      "creation_status": "DONE",
      "vouchers_generation_status": "DONE",
      "protected": true,
      "validation_rules_assignments": {
        "object": "list",
        "data_ref": "data",
        "data": [
          {
            "id": "asgm_N7t39epaQR2SkQcW",
            "rule_id": "val_ssbxf1L9aKri",
            "related_object_id": "camp_AaP9MC1Y0GpBII84UTIuasvb",
            "related_object_type": "campaign",
            "created_at": "2022-02-14T15:12:06.817Z",
            "object": "validation_rules_assignment",
            "rule": {}
          }
        ],
        "total": 123
      },
      "category_id": "cat_0b688929a2476386a7",
      "categories": {
        "id": "<string>",
        "name": "<string>",
        "hierarchy": 1,
        "object": "category",
        "created_at": "2022-07-14T10:45:13.156Z",
        "updated_at": "2022-08-16T10:52:08.094Z"
      },
      "object": "campaign",
      "referral_program": {
        "conversion_event_type": "redemption",
        "custom_event": {
          "id": "ms_fi47Dcu5T0m3v3nT5ch3ma",
          "name": "<string>"
        },
        "referee_reward": {
          "related_object_parent": {
            "id": "<string>",
            "name": "<string>",
            "object": "<string>"
          },
          "type": "LOYALTY_CARD",
          "amount": "<string>"
        }
      }
    }
  ],
  "total": 123,
  "id": "qfl_dNZ3gWfKVNa8Zw15hn30uqdU",
  "created_at": "2023-04-04T13:13:03.119Z",
  "tracking_id": "<string>"
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Query Parameters

audienceRulesOnly
boolean

This parameter set to true will ask only for verifying vouchers' validation rules only against conditions applied to audiences' attributes (belonging into segment and Customer metadata)

limit
integer

The number of campaigns to be qualified. The maximum number is 50.

Required range: 1 <= x <= 50
order
enum<string>

Sorts the results using one of the filtering options, where the dash - means sorting in a descending order.

Available options:
created_at,
-created_at,
updated_at,
-updated_at,
type,
-type,
code,
-code,
category,
-category,
campaign,
-campaign

Body

application/json

Request body schema for POST v1/campaigns/qualification.

customer
object

Customer's information. You can pass the unique customer ID that was assigned by Voucherify.

  • Customer ID
  • Customer Source ID
  • Customer
order
object

Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the <!-- [Order object reference](OpenAPI.json/components/schemas/OrdersUpdateResponseBody) -->Order object. You can pass the unique order ID that was assigned by Voucherify.

  • Order ID
  • Order Source ID
  • Order Customer And Referrer Ids Objects

Response

200 - application/json

This operation returns the list of valid and active campaigns based on the qualification of a given context (e.g., customer profile, redemptions metadata, order).<!-- [Read](https://docs.voucherify.io/docs/checking-eligibility-for-coupons)-->

Read about Qualification API limits before you start.

Response body schema for POST v1/campaigns/qualification.

object
string
default:list

The type of the object represented by JSON. This object stores information about campaigns in a dictionary.

data_ref
string
default:data

Identifies the name of the attribute that contains the array of campaign objects.

data
Campaign Object · object[]

Contains array of campaign objects.

total
integer

Total valid and active campaigns matching the qualification criteria in given context.

id
string

Unique qualification ID.

Example:

"qfl_dNZ3gWfKVNa8Zw15hn30uqdU"

created_at
string<date-time>

Timestamp representing the date and time when the qualification was created. The value is shown in the ISO 8601 format.

Example:

"2023-04-04T13:13:03.119Z"

tracking_id
string

Hashed customer source ID.

I